% \iffalse meta-comment
%
%  UW-WORK-REPORT
%
%  Copyright (C) 2008  Scott Stobbe - 09/06/08
%
%  uw-work-report is free software; you can redistribute it and/or modify
%  it under the terms of the GNU General Public License as published by
%  the Free Software Foundation; either version 3 of the License, or
%  any later version.
%
%  uw-work-report is distributed in the hope that it will be useful,
%  but WITHOUT ANY WARRANTY; without even the implied warranty of
%  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%  GNU General Public License for more details.
%
%  You should have received a copy of the GNU General Public License
%  along with this program.  If not, see <http://www.gnu.org/licenses/>.
%
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
%  TODO:
%          o Define the final set of dimensions
%          o Listings need to merge into list of figures
% 
% 
% 
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
%
% \fi
%
% \iffalse
%<*driver>
\ProvidesFile{uw-work-report.dtx}
%</driver>
%<class>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<class>\ProvidesClass{ uw-work-report }
%<*class>
    [ 2008/11/22 ECE Compliant Latex Template]
%</class>
%
%<*driver>
\documentclass{ltxdoc}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
  \DocInput{uw-work-report.dtx}
\end{document}
%</driver>
% \fi
%
% \CheckSum{0}
%
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%
%
% \changes{v0.1}{2008/11/22}{Initial version}
%

% \GetFileInfo{uw-work-report.dtx}
%
% \DoNotIndex{ list of control sequences }
%
% \title{The \textsf{ uw-work-report } class\thanks{This document 
%  corresponds to \textsf{ uw-work-report }~\fileversion,
%   dated \filedate.}}
% \author{ Scott Stobbe \\ \texttt{ scott.j.stobbe@gmail.com }}
%
% \maketitle
%
% \begin{abstract}
%   A report using this class submitted Fall 2008, received no penalties for improper 
%   formatting.
% \end{abstract}
%
% \section{Introduction}
%		
% 
%
% \section{Usage}
%
% \StopEventually{\PrintIndex}
%
% \section{Implementation}
%


% \begin{macro}{base class}
% 
%    \begin{macrocode}
\LoadClass[letterpaper,12pt]{report}
%    \end{macrocode}
% \end{macro}

% ^^A \global\let\@debugColor\@empty

% \begin{macro}{counters}
% 
%    \begin{macrocode}
\newcounter{debugcoloring}
\newcounter{noimages}
%    \end{macrocode}
% \end{macro}

% ^^A \setcounter{debugcoloring}{0}

% \begin{macro}{Options}
% 
%    \begin{macrocode}
\DeclareOption{no-image}{\setcounter{noimages}{1}}
\DeclareOption{debug-color}{\setcounter{debugcoloring}{1}}
\ProcessOptions
%    \end{macrocode}
% \end{macro}


% \begin{macro}{Required Packages}
% 
%    \begin{macrocode}
\RequirePackage{url}
\RequirePackage{listings}
% |\usepackage[small,compact]{titlesec}|
% |\usepackage[ECE]{fncychap}|
\RequirePackage[titles]{tocloft}
\RequirePackage{rotating}
\RequirePackage{graphicx}
% Line Spacing
\RequirePackage{setspace}
% Times Font
\RequirePackage{times}
% Sectioning Titles

% Advanced Captions
\RequirePackage[labelfont=bf]{caption}

\RequirePackage{fancyhdr}
%    \end{macrocode}
% \end{macro}



% \begin{macro}{\rpBuildSettings}
% 
%    \begin{macrocode}
\newcommand{\rpBuildSettings}{%
	\begin{description}
	
	\item Color-Titles Enabled: 
		\ifnum \thedebugcoloring = 0 
		FALSE
		\else
		TRUE
		\fi  
	\end{description}
}
%    \end{macrocode}
% \end{macro}



% Define Section title fonts / spacing
% \begin{macro}{\chapter}
% 
%    \begin{macrocode}
\renewcommand{\chapter}{%
  \newpage
  \@startsection
      {chapter}{0}%
      {\z@} % No indent
      {\z@} % Chapters start on a new page anyhow
      {20pt}% Two Lines
      {\fontsize{14}{\f@baselineskip}\bf\sffamily
			\ifnum\thedebugcoloring = 0
			\else
				\color{blue}
			\fi}%
}
%    \end{macrocode}
% \end{macro}

% Define Section title fonts / spacing
% \begin{macro}{\section}
% 
%    \begin{macrocode}
\renewcommand{\section}{%
\@startsection
		{section}{1}%
		{\z@} % No indent
		{4ex plus 0.1ex minus -.2ex} % 
		{1ex plus 0.1ex minus -.2ex}% Two Lines
		{\fontsize{12}{\f@baselineskip}\bf\ifnum \thedebugcoloring = 0
		\else\color{orange}\fi}%
}%
%    \end{macrocode}
% \end{macro}


% Define Section title fonts / spacing
% \begin{macro}{\subsection}
% 
%    \begin{macrocode}
\renewcommand{\subsection}{%
  \@startsection
      {subsection}{2}%
      {\z@} % No indent
      {-1.5ex plus -1ex minus -.2ex} % 
      {1ex}% Two Lines
      {\fontsize{12}{\f@baselineskip}\bf\ifnum \thedebugcoloring = 0
		\else\color{red}\fi}%
}

%    \end{macrocode}
% \end{macro}

% Define Section title fonts / spacing
% \begin{macro}{\subsubsection}
% 
%    \begin{macrocode}
\renewcommand{\subsubsection}{%
  \@startsection
      {section}{3}%
      {\z@} % No indent
      {-1.5ex plus -1ex minus -.2ex} %
      {1ex}% Two Lines
      {\fontsize{12}{\f@baselineskip}\bf
			\ifnum \thedebugcoloring = 0
			\else
				\color{yelloworange}
			\fi}%
}
%    \end{macrocode}
% \end{macro}



% ^^A Margin Definitions, 
% ^^A\marginZ, where Z: {l (left),r (right),t (top),b (bottom)}

% Define Section title fonts / spacing
% \begin{macro}{Margins}
% 
%    \begin{macrocode}
\newlength{\marginl}
\setlength{\marginl}{1.5in}

\newlength{\marginr}
\setlength{\marginr}{1in}

\newlength{\marginb}
\setlength{\marginb}{1in}

\newlength{\margint}
\setlength{\margint}{1in}

\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}
\setlength{\headsep}{0pt}
\setlength{\topskip}{0pt}
\setlength{\topmargin}{0pt}
\setlength{\topsep}{0pt}
\setlength{\partopsep}{0pt}
\setlength{\footskip}{12pt}


% 
% Margins
\RequirePackage[right=\marginb, top=\margint, bottom=\marginb, left=\marginl ]{geometry}
%    \end{macrocode}
% \end{macro}




% Define Section title fonts / spacing
% \begin{macro}{Header/Footer}
% 
%    \begin{macrocode}
\fancyhead{}
\fancyfoot{}
%    \end{macrocode}
% \end{macro}



% ^^A \lhead[lh-even]{lh-odd}
% ^^A \chead[ch-even]{ch-odd}
% ^^A \rhead[rh-even]{rh-odd}
%^^A  \rfoot[rf-even]{rf-odd}
%^^A \cfoot[cf-even]{cf-odd}
%^^A \lfoot[lf-even]{lf-odd}
%^^A 

% \begin{macro}{ECE}
% 
%    \begin{macrocode}
\fancypagestyle{ECE}{%
\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\thepage} % Show Page number Centered in footer on each page
\renewcommand{\headrulewidth}{0pt} %Remove hline
\renewcommand{\footrulewidth}{0pt} %Remove hline
}
%    \end{macrocode}
% \end{macro}




% \begin{macro}{\rpBuildSettings}
%
% We Like to have unity in our formatting so, enable ECE formatting on
% Chapter title pages, etc. the |\chapter{}| command defaults to the plain page
% style (we dont want that) so override with ECE Styling
%
%    \begin{macrocode}
\fancypagestyle{plain}{%
\pagestyle{ECE}
}
%    \end{macrocode}
% \end{macro}



% \begin{macro}{\rpBuildSettings}
%
% Default leader in Table of Header/Figures/Tables
% Change if you like.
%
%    \begin{macrocode}
\renewcommand{\cftdot}{.}
}
%    \end{macrocode}
% \end{macro}



% \begin{macro}{\rpBuildSettings}
% 
%	Quoting: ``The tocloft package'', Peter Wilson, Pages 8-9
% 
% \begin{verbatim}
% 	In the following I will use X to stand for the following:
% 	• part for \part titles
% 	• chap for \chapter titles
% 	• sec for \section titles
% 	• subsec for \subsection titles
% 	• subsubsec for \subsubsection titles
% 	• para for \paragraph titles
% 	• subpara for \subparagraph titles
% 	• fig for figure \caption titles
% 	• subfig for subfigure \caption titles
% 	• tab for table \caption titles
% 	• subtab for subtable \caption titles
% 
% 	\newcommand{\cftXfont}{}
% 	\newcommand{\cftXaftersnum}{}
% 	\newcommand{\cftXaftersnumb}{}
% 	\newcommand{\cftXleader}{\cftdotfill{\cftXdotsep}}
% 	\newcommand{\cftXdotsep}{\cftdotsep}
% 	\newcommand{\cftXpagefont}{}
% 	\newcommand{\cftXafterpnum}{}
% \end{verbatim}
% 
% 	End of Quote.
% 
%    \begin{macrocode}
%
% By default the ToC does not lead chapters, if you would like this effect
% enable the following
% |\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}|
%    \end{macrocode}
% \end{macro}



% \begin{macro}{\rpBuildSettings}
%
% Should you like to change the title of the Tables of Contents from "Contents" 
%
%    \begin{macrocode}
\renewcommand{\contentsname}{Table of Contents}
%|\renewcommand{\listfigurename}{List of Figures} |% Default is: List of Figures
%|\renewcommand{\listtablename}{List of Tables} |% Default is: List of Tables
\renewcommand{\lstlistlistingname}{List of Listings}
%    \end{macrocode}
% \end{macro}



% \begin{macro}{\rpBuildSettings}
%
%
%    \begin{macrocode}
\pagestyle{ECE}
%    \end{macrocode}
% \end{macro}


%
%^^A Good package
%^^A 
%^^A |\usepackage{listings}|
%^^A |\lstset{breaklines=true}|
% 

% \begin{macro}{\StudentCredentials}
%
% Undecided whether or not to provide 
% Letter and title page generation
% 
%    \begin{macrocode}
\newcommand{\studentName}[1]{%
\gdef\@studentName{#1}
}
\def\author{%
\@studentName
}

\def\studentID{}
\newcommand{\studentIDVar}[1]{
\def\studentID{#1}
}

\def\studentUserID{}
\newcommand{\studentUserIDVar}[1]{
\def\studentUserID{#1}
}
%    \end{macrocode}
% \end{macro}





% \begin{verbatim}
% \def\@abc{````}
% \newcommand{\helpo}[1]{
% \gdef\helpo{#1}
% \gdef\@helpo{#1}
% }
% \end{verbatim}



%^^A \def\tes{%
%^^A \ifnum \c@secnumdepth = -1
%^^A a
%^^A \fi
%^^A abc
%^^A }

% \begin{macro}{\StudentCredentials}
%
% Undecided whether or not to provide 
% Letter and title page generation
% 
%    \begin{macrocode}
\newcommand{\tableoftables}{%
\addcontentsline{toc}{chapter}{\listtablename}
\listoftables
\pagestyle{ECE}
}

\newcommand{\tableoffigures}{%
\addcontentsline{toc}{chapter}{\listfigurename}
\listoffigures
\pagestyle{ECE}
}

\newcommand{\printtables}{%
\tableofcontents
\tableoffigures
\tableoftables
% These are not to Report Guidelines
% \begin{verbatim}
% \addcontentsline{toc}{chapter}{\lstlistlistingname}
% \lstlistoflistings
% \listofmyequations
% \end{verbatim}
}
%    \end{macrocode}
% \end{macro}



% \begin{macro}{\StudentCredentials}
%
% Usage: |\insertimage{ File Name }{ Label Key }{ Caption }|
% 
%    \begin{macrocode}
\newlength{\templen}

\newcommand{\insertimage}[3]{%
\begin{figure}[h]
\begin{center}
\ifnum \thenoimages = 0
	\setlength{\templen}{-0.5in}
	\addtolength{\templen}{\textwidth}
	\includegraphics[width=\templen]{#1}
\else
\fi
\end{center}
\caption{#3}
\label{#2}
\end{figure}
}
%    \end{macrocode}
% \end{macro}


% \begin{macro}{\matters}
%
% Usage: |\insertimage{ File Name }{ Label Key }{ Caption }|
% 
%    \begin{macrocode}
% \newcommand{\frontmatter}{%
% \pagenumbering{roman}
% \setcounter{secnumdepth}{-1}
% \singlespacing
% }

\newenvironment{titlepagestyle}{%
\pagenumbering{roman}
\thispagestyle{empty}
}{%
% EMPTY
}

\newenvironment{lettermatter}{%
\pagenumbering{roman}
\setcounter{secnumdepth}{-1}
\thispagestyle{empty}
\singlespacing
}{%
% EMPTY
}

\newenvironment{frontmatter}{%
\pagenumbering{roman}
\setcounter{secnumdepth}{-1}
\onehalfspacing
}{%
% EMPTY
}

\newenvironment{reportbody}{%
\pagenumbering{arabic}
\onehalfspacing
\setcounter{secnumdepth}{5}
}{%
% EMPTY
}
\newenvironment{backmatter}{%
\pagenumbering{arabic}
\setcounter{secnumdepth}{-1}
\singlespacing
}{%
% EMPTY
}
%    \end{macrocode}
% \end{macro}



% \Finale
\endinput

